package io.rainforest.rss.web.demo;


import com.alibaba.cola.dto.SingleResponse;
import io.rainforest.rss.dao.po.RssMain;
import io.rainforest.rss.service.demo.DemoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Api(tags = "demo")
@RequestMapping("/v1/demo/")
@Slf4j
public class DemoController {

    @Autowired
    DemoService demoService;

    @ApiOperation(value = "查询订阅列表")
    @PostMapping("demo1")
    @ResponseBody
    public SingleResponse<List<RssMain>> demo1() {
        SingleResponse singleResponse = SingleResponse.buildSuccess();
        singleResponse.setData(demoService.queryRssList());
        return singleResponse;
    }

}
